/*
 * @Description  : Phase Follow Application Module
 * @Version      : 0.1
 * @Company      : V-Think Development Team
 * @Author       : KiraVerSace@yeah.net
 * @Date         : 2025-01-22 14:00:00
 */
#ifndef _APP_PHASE_FOLLOW_H_
#define _APP_PHASE_FOLLOW_H_

#include <xCommon.h>
#include <RingBuf.h>
#include <appWatchdog.h>

// Phase Follow GPIO定义
#define PHASE1_BIT_POSITION     0
#define PHASE2_BIT_POSITION     1
#define PHASE3_BIT_POSITION     2
#define PHASE_IN1               PA8  // 用于计算输入PWM的频率和占空比
#define PHASE_IN2               PC8
#define PHASE_IN3               PC9
#define PHASE_OUT1              PB0
#define PHASE_OUT2              PB1
#define PHASE_OUT3              PB2

// Phase Follow定时器定义
#define PHASE_SAMPLE_TIMER      TIM2
#define PHASE_DELAY_TIMER       TIM3
#define PHASE_MEASURE_TIMER     TIM1

extern TaskHandle_t phaseFollowTaskHandle;
void phaseFollowTask(void *pvParameters);

#endif
